<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="js/jquery-1.11.3.js" type="text/javascript"></script>
<title>Insert title here</title>
<script type="text/javascript">
		function ajaxGet(){
			$.get(
				"/JavaWeb1907/ajax",
				{"name":"李雷","age":23},
				function(date){
					alert("name:" + date.name + ",age:" + date.age);
				},
				"json"
			);
		}
		
		function ajaxPost(){
			$.post(
				"/JavaWeb1907/ajax",
				{"name":"韩梅梅","age":20},
				function(date){
					alert("name:" + date.name + ",age:" + date.age);
				},
				"json"
			);
		}
		
		function ajax(){
			$.ajax({
// 				async : true,
				url : "/JavaWeb1907/ajax",
				data : {"name":"孟飞","age":22},
				type : "post",
				dataType : "json",
				success : function(jsonObj){
					alert("name:" + jsonObj.name + ",age:" + jsonObj.age);
				}
			});
		}
	</script>
</head>
<body>
	<button onclick="ajaxGet()">Ajax Get</button>
	<button onclick="ajaxPost()">Ajax Post</button>
	<button onclick="ajax()">Ajax</button>
</body>
</html>